home *** CD-ROM | disk | FTP | other *** search
- Path: newshost.lanl.gov!tanmoy
- From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
- Newsgroups: comp.lang.c
- Subject: Re: What is the correct behaviour ?
- Date: 09 Mar 1996 21:56:52 GMT
- Organization: Los Alamos National Laboratory
- Message-ID: <TANMOY.96Mar9145652@qcd.lanl.gov>
- References: <1996Mar9.130223.1400@paramount.nikhefk.nikhef.nl>
- NNTP-Posting-Host: qcd.lanl.gov
- Mime-Version: 1.0
- Content-Type: text
- In-reply-to: bouvere@paramount.nikhefk.nikhef.nl's message of Sat, 9 Mar 1996 13:02:23 GMT
-
- In article <1996Mar9.130223.1400@paramount.nikhefk.nikhef.nl>
- bouvere@paramount.nikhefk.nikhef.nl (Ferdinand de Bouvere) writes:
-
- FdB: Trying this code on 3 platforms:
- FdB:
- FdB: int a = 0;
- FdB:
- FdB: main()
- FdB: {
- FdB: int a = 123;
- FdB: {
- FdB: extern int a;
- FdB: printf("%d\n", a);
- FdB: }
- FdB: }
- FdB:
- FdB: HP/UX compiler: OK
- FdB: result: 0
-
- The above is the correct behaviour under ANSI.
-
- FdB:
- FdB: Linux gcc: OK
- FdB: result: 123
- FdB:
- FdB: SUN compiler (pre ansi): compile error:
- FdB: "c.c", line 7: redeclaration of a
- FdB: Compilation failed
- FdB:
- FdB: So, what should be the correct behaviour ?
-
- Cheers
- Tanmoy
- --
- tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
- Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
- Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
- <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
- internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
- fax: 1 (505) 665 3003 voice: 1 (505) 665 4733 [ Home: 1 (505) 662 5596 ]
-